package com.xizi;

import java.util.concurrent.atomic.AtomicInteger;

public class Main {
    public static void main(String[] args) {
        AtomicInteger integer = new AtomicInteger(5);
        // true 100
        System.out.println(integer.compareAndSet(5, 100) + " " + integer.get());
        integer.compareAndSet(5, 30);
        //false 100
        System.out.println(integer.compareAndSet(5, 30) + " " + integer.get());
    }
}
